<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".ui.screens.search.SearchOptionsFragment">

    <com.google.android.material.appbar.AppBarLayout
        android:id="@+id/appBarLayout"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <androidx.appcompat.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            app:navigationIcon="@drawable/ic_back_navigation">

            <TextView
                android:id="@+id/toolbar_title"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:text="@string/app_bar_title_search_options"
                android:textSize="@dimen/app_bar_title_size"
                android:textStyle="bold" />
        </androidx.appcompat.widget.Toolbar>
    </com.google.android.material.appbar.AppBarLayout>

    <androidx.core.widget.NestedScrollView
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:fillViewport="true"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/appBarLayout">

        <androidx.constraintlayout.widget.ConstraintLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:padding="@dimen/default_margins">

            <TextView
                android:id="@+id/optionsTextView"
                style="@style/film_category_name"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="Show"
                app:layout_constraintTop_toTopOf="parent" />

            <RadioGroup
                android:id="@+id/filmTypeRadioLayout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@drawable/search_option_radio_group"
                android:elevation="24dp"
                android:orientation="horizontal"
                app:layout_constraintTop_toBottomOf="@id/optionsTextView">

                <RadioButton
                    android:id="@+id/allRB"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:background="@drawable/radio_button_first"
                    android:button="@null"
                    android:checked="true"
                    android:text="@string/film_collection_view_button_all"
                    android:textAlignment="center"
                    android:textSize="14sp" />

                <RadioButton
                    android:id="@+id/filmRB"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:background="@drawable/radio_button_normal"
                    android:button="@null"
                    android:text="@string/search_option_films"
                    android:textAlignment="center"
                    android:textSize="14sp" />

                <RadioButton
                    android:id="@+id/serialRB"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:background="@drawable/radio_button_last"
                    android:button="@null"
                    android:text="@string/search_option_serials"
                    android:textAlignment="center"
                    android:textSize="14sp" />
            </RadioGroup>

            <androidx.constraintlayout.widget.ConstraintLayout
                android:id="@+id/countryLayout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginVertical="@dimen/default_margins"
                app:layout_constraintTop_toBottomOf="@id/filmTypeRadioLayout">

                <TextView
                    android:id="@+id/countryLabel"
                    style="@style/film_category_name"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:text="@string/country_label"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintEnd_toStartOf="@id/countryTextView"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toTopOf="parent" />

                <TextView
                    android:id="@+id/countryTextView"
                    style="@style/film_item_genre"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toEndOf="@id/countryLabel"
                    app:layout_constraintTop_toTopOf="parent" />
            </androidx.constraintlayout.widget.ConstraintLayout>

            <androidx.constraintlayout.widget.ConstraintLayout
                android:id="@+id/genreLayout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginVertical="@dimen/default_margins"
                app:layout_constraintTop_toBottomOf="@id/countryLayout">

                <TextView
                    android:id="@+id/genreLabel"
                    style="@style/film_category_name"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:text="@string/genre_label"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintEnd_toStartOf="@id/genreTextView"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toTopOf="parent" />

                <TextView
                    android:id="@+id/genreTextView"
                    style="@style/film_item_genre"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toEndOf="@id/genreLabel"
                    app:layout_constraintTop_toTopOf="parent" />
            </androidx.constraintlayout.widget.ConstraintLayout>

            <androidx.constraintlayout.widget.ConstraintLayout
                android:id="@+id/yearLayout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginVertical="@dimen/default_margins"
                app:layout_constraintTop_toBottomOf="@id/genreLayout">

                <TextView
                    android:id="@+id/yearLabel"
                    style="@style/film_category_name"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:text="@string/year_label"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintEnd_toStartOf="@id/yearTextView"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toTopOf="parent" />

                <TextView
                    android:id="@+id/yearTextView"
                    style="@style/film_item_genre"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toEndOf="@id/yearLabel"
                    app:layout_constraintTop_toTopOf="parent" />
            </androidx.constraintlayout.widget.ConstraintLayout>

            <androidx.constraintlayout.widget.ConstraintLayout
                android:id="@+id/rateLayout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginVertical="@dimen/default_margins"
                app:layout_constraintTop_toBottomOf="@id/yearLayout">

                <TextView
                    android:id="@+id/rateLabel"
                    style="@style/film_category_name"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:text="@string/rate_label"
                    app:layout_constraintBottom_toTopOf="@id/rateRangeSlider"
                    app:layout_constraintEnd_toStartOf="@id/rateTextView"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toTopOf="parent" />

                <TextView
                    android:id="@+id/rateTextView"
                    style="@style/film_item_genre"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    app:layout_constraintBottom_toTopOf="@id/rateRangeSlider"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toEndOf="@id/rateLabel"
                    app:layout_constraintTop_toTopOf="parent" />

                <com.google.android.material.slider.RangeSlider
                    android:id="@+id/rateRangeSlider"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:valueFrom="0.0"
                    android:valueTo="10.0"
                    app:layout_constraintTop_toBottomOf="@id/rateLabel"
                    app:thumbColor="@color/white"
                    app:thumbHeight="25dp"
                    app:thumbStrokeColor="?colorSecondary"
                    app:thumbStrokeWidth="1dp"
                    app:thumbWidth="25dp"
                    app:trackColor="?colorPrimary"
                    app:trackHeight="@dimen/_6sdp"
                    app:values="@array/slider_values" />
            </androidx.constraintlayout.widget.ConstraintLayout>

            <TextView
                android:id="@+id/sortTextView"
                style="@style/film_category_name"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginVertical="@dimen/default_margins"
                android:text="Sort"
                app:layout_constraintTop_toBottomOf="@id/rateLayout" />

            <RadioGroup
                android:id="@+id/sortTypeRadioLayout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@drawable/search_option_radio_group"
                android:elevation="24dp"
                android:orientation="horizontal"
                app:layout_constraintTop_toBottomOf="@id/sortTextView">

                <RadioButton
                    android:id="@+id/dateRB"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:background="@drawable/radio_button_first"
                    android:button="@null"
                    android:checked="true"
                    android:text="@string/sort_film_date"
                    android:textAlignment="center"
                    android:textSize="14sp" />

                <RadioButton
                    android:id="@+id/popularRB"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:background="@drawable/radio_button_normal"
                    android:button="@null"
                    android:text="@string/sort_film_popular"
                    android:textAlignment="center"
                    android:textSize="14sp" />

                <RadioButton
                    android:id="@+id/rateRB"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:background="@drawable/radio_button_last"
                    android:button="@null"
                    android:text="@string/sort_film_rate"
                    android:textAlignment="center"
                    android:textSize="14sp" />
            </RadioGroup>

            <androidx.constraintlayout.widget.ConstraintLayout
                android:id="@+id/seenLayout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginVertical="@dimen/default_margins"
                android:layout_marginBottom="@dimen/default_margins"
                app:layout_constraintTop_toBottomOf="@id/sortTypeRadioLayout">

                <ImageView
                    android:id="@+id/seenLabel"
                    style="@style/film_category_name"
                    android:layout_width="50dp"
                    android:layout_height="50dp"
                    android:src="@drawable/ic_seen"
                    android:text="@string/rate_label"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toTopOf="parent"
                    app:tint="?colorPrimary" />

                <TextView
                    android:id="@+id/seenTextView"
                    style="@style/film_category_name"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="Watched"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintHorizontal_bias="0.2"
                    app:layout_constraintStart_toEndOf="@id/seenLabel"
                    app:layout_constraintTop_toTopOf="parent" />
            </androidx.constraintlayout.widget.ConstraintLayout>
        </androidx.constraintlayout.widget.ConstraintLayout>
    </androidx.core.widget.NestedScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>